#ifndef CRYPTHELPER_H
#define CRYPTHELPER_H

#include <string>


enum AesMode{
    ECB, CBC, CBC_CTS, CFB, OFB, CTR
};

class CryptHelper
{
private:
    CryptHelper();
    ~CryptHelper();
public:
    // eg:string aesKey = "0123456789ABCDEF0123456789ABCDEF";//256bits
    //    string aesIV = "ABCDEF0123456789";//128 bits
    /*
        string s1, s2;
        s1 = CryptHelper::encrypt(plainText.c_str(), aesKey);
        s2 = CryptHelper::decrypt(s1.c_str(), aesKey);
        qDebug() << "ECB:" << s2 << " [" << s1 << "]" << endl;
    */
    static std::string encrypt(const char *plainText, const std::string &sKey, const std::string &sIV = "", const AesMode &mode = AesMode::ECB);
    static std::string decrypt(const char *cipherText, const std::string &sKey, const std::string &sIV = "", const AesMode &mode = AesMode::ECB);
};

#endif // CRYPTHELPER_H
